Skip to content

Conversation

@elevran
Copy link
Contributor

@elevran elevran commented Nov 20, 2025

What type of PR is this?
/kind deprecation

What this PR does / why we need it:
Defining a metric port via CLI conflicts with use of multiport inference pool and/or changes to inference-pool at runtime (see #1396 and #1398).

Which issue(s) this PR fixes:
Fixes #1398
Fixes #1396

Does this PR introduce a user-facing change?:

The EPP `--model-server-metrics-port` CLI option is being deprecated and shall be removed in an upcoming release.

@k8s-ci-robot k8s-ci-robot added the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Nov 20, 2025
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 3bb2092
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/691f359bce43930008f9456d
😎 Deploy Preview https://deploy-preview-1886--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: elevran
Once this PR has been reviewed and has the lgtm label, please assign nirrozenbaum for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 20, 2025
Comment on lines +135 to +137
modelServerMetricsPort = flag.Int("model-server-metrics-port", 0, "[DEPRECATED] Port to scrape metrics from pods. "+
"Default value will be set to the InferencePool.Spec.TargetPorts[0].Number if not set."+
"[DEPRECATED] This option will be removed in the next release.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put the [DEPRECATED] note only once?

Suggested change
modelServerMetricsPort = flag.Int("model-server-metrics-port", 0, "[DEPRECATED] Port to scrape metrics from pods. "+
"Default value will be set to the InferencePool.Spec.TargetPorts[0].Number if not set."+
"[DEPRECATED] This option will be removed in the next release.")
modelServerMetricsPort = flag.Int("model-server-metrics-port", 0, "[DEPRECATED] Port to scrape metrics from pods. "+
"Default value will be set to the InferencePool.Spec.TargetPorts[0].Number if not set."+
"This option will be removed in the next release.")

Comment on lines +473 to +498
func (r *Runner) deprecatedFlagsHandler(logger logr.Logger) error {
deprecated := map[string]string{ // Map of deprecated flags: key = flag name, value = replacement (empty if none)
"model-server-metrics-port": "",
}

var usedDeprecated []string // Track which deprecated flags were explicitly set
flag.Visit(func(f *flag.Flag) {
if _, ok := deprecated[f.Name]; ok {
usedDeprecated = append(usedDeprecated, f.Name)
}
})

if len(usedDeprecated) > 0 { // report on deprecated flags used
for _, option := range usedDeprecated {
if replacement := deprecated[option]; replacement != "" {
logger.Info("deprecated option will be removed in the next release",
"option", option, "replacement", replacement)
} else {
logger.Info("deprecated option will be removed in the next release. No replacement available.",
"option", option)
}
}
return errors.New("deprecated options used" + fmt.Sprintf("%+v", usedDeprecated))
}
return nil
}
Copy link
Contributor

@nirrozenbaum nirrozenbaum Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can be simplified to a 5 liner.
few points:

  • as for now, we have no depracated flag that is replaced by a different flag. so the replacement part seems redundant.
  • no need to use map for deprecated (can be a set or just a const as long as this is a single string).
  • no need to run flag.Visit and then iterating over it again. while we're at the flag.Visit, we can check - if the depracated flag is used, log the deprecation notice.
  • no need to return error (which is later ignored anyway).

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support changing InferencePool port at runtime? InferencePool port specification (e.g., serving, metrics and health)

3 participants